<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<style type="text/css">
	.bigger{
		background-color:gray
	}
</style>
<body>
<a href="logout">退出登录</a>
	<table border=1>
		<tr>
			<c:if test="${address eq '1' }">
				<td class="bigger"><a href="showGoods?address=1">天津</a></td>
				<td><a href="showGoods?address=2">上海</a></td>
				<td><a href="showGoods?address=3">香港</a></td>
			</c:if>
			<c:if test="${address eq '2' }">
				<td><a href="showGoods?address=1">天津</a></td>
				<td class="bigger"><a href="showGoods?address=2">上海</a></td>
				<td><a href="showGoods?address=3">香港</a></td>
			</c:if>
			<c:if test="${address eq '3' }">
				<td><a href="showGoods?address=1">天津</a></td>
				<td><a href="showGoods?address=2">上海</a></td>
				<td class="bigger"><a href="showGoods?address=3">香港</a></td>
			</c:if>
			
		</tr>
		<th>商品名称</th>
				<th>商品价格</th>
				<th>商品数量</th>
				<th>生产时间</th>
				<th>生产地址</th>
		<c:forEach items="${goodsList}" var="g" varStatus="s">
			<c:if test="${s.index%2==0 }">
				<tr class="even">
			</c:if>
				<td>${g.gname}</td>
				<td>
					<fmt:formatNumber value="${g.price }" pattern="$##,###.00"></fmt:formatNumber>
				</td>
				<td>${g.count}</td>
				<td>
					<fmt:formatDate value="${g.gDate}" pattern="yyyy年MM月dd日"/>
				</td>
				
				<c:if test="${address eq '1' }">
				<td>天津</td>
				</c:if>
				<c:if test="${address eq '2' }">
				<td>上海</td>
				</c:if>
				<c:if test="${address eq '3' }">
				<td>香港</td>
				</c:if>
				<td><a href="delete?id=${g.gid}">删除</a></td>
				<td><a href="edit?id=${g.gid}">更新</a></td>
				
			</tr>
		</c:forEach>
	</table>
</body>
</html>